Component({
  properties: {
    // 这里定义了innerText属性，属性值可以在组件使用时指定
    innerText: {
      type: String,
      value: 'default value',
    }
  },
  data: {
    dataText: '',
    dataType: '',
    dataTips: '',
    totastType:'',
    isShow:false
  },
  methods: {
    //隐藏弹框
    hideDialog() {
      this.setData({
        isShow: false
      })
    },
    //展示弹框
    showDialog(data) {
       console.log(data)
      if(data.totastType==undefined){
        data.totastType=''
      }
      if(data.code == "loading"){
        console.log(data.code);
        this.setData({
          dataType: '../../images/icon/icon_' + data.code +'.gif',
          isShow: true,
          dataText: data.message,
          dataTips:data.tips,
          totastType:data.totastType
        })
        console.log(this.data)
        return
      }else{
        this.setData({
          isShow: true,
          dataText: data.message,
          dataTips:data.tips,
          totastType:data.totastType,
          dataType: '../../images/icon/icon_' + data.code +'.png'
        })
      }
     
      var _this = this
      // 定时器关闭  
      if(data.timeout){
        setTimeout(function () {
          _this.hideDialog()
        }, 1000);
      }
      
    }
  }
})